<!-- 主页-报价协议-查看 -->
<section id="container">
    <!--main content start-->
    <section id="main-content">
        <section class="wrapper">
            <!--state overview end-->
            <div class="row">
                <div class="col-lg-12">
                    <div class="ptop-list">

                        <section class="panel">
                            <header class="panel-heading">
                                本协议内购买的物品清单(显示提交报价协议时勾选的条目)
                            </header>
                            <div class="panel-body">
                                <div id="purchaselistContainer" class="dlshouwen-grid-container"></div>
                                <div id="purchaselistToolBarContainer" class="dlshouwen-grid-toolbar-container"></div>
                            </div>
                        </section>

                        <section class="panel">
                            <div class="panel-body">
                                <div class="form-group customerForm">
                                    <label class="col-sm-2 control-label">比价单*</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" disabled placeholder="自动检索" ng-model="agreement.pcsCode">
                                    </div>
                                </div>
                                <div class="form-group customerForm">
                                    <label class="col-sm-2 control-label">供应商名称*</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" disabled placeholder="自动检索" ng-model="agreement.supplierName">
                                    </div>
                                </div>
                                <div class="form-group customerForm">
                                    <label class="col-sm-2 control-label">归属分公司*</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" disabled placeholder="自动检索" ng-model="agreement.affiliateName">
                                    </div>
                                </div>
                                <div class="form-group customerForm">
                                    <label class="col-sm-2 control-label">合同编号</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" certus-an-limit-length="50"
                                            certus-required disabled ng-model="agreement.contractCode">
                                    </div>
                                </div>
                                <div class="form-group customerForm">
                                    <label class="col-sm-2 control-label">价格(含税&折扣)*</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" disabled ng-model="agreement.priceDiscount">
                                    </div>
                                </div>
                                <div class="form-group customerForm">
                                    <label class="col-sm-2 control-label">交货期</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" disabled certus-required ng-model="agreement.deliveryDate">
                                    </div>
                                </div>
                                <div class="form-group customerForm">
                                    <label class="col-sm-2 control-label">质保期*</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" disabled ng-model="agreement.guaranteeDate">
                                    </div>
                                </div>
                                <div class="form-group customerForm">
                                    <label class="col-sm-2 control-label">付款方式</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" disabled certus-required ng-model="agreement.paymentMethod">
                                    </div>
                                </div>
                                <div class="form-group customerForm">
                                    <label class="col-sm-2 control-label">留言</label>
                                    <div class="col-sm-10">
                                        <textarea class="form-control" maxlength="120" disabled ng-model="agreement.agreementMsg"></textarea>
                                    </div>
                                </div>
                                <div class="form-group customerForm">
                                    <label class="col-sm-2 control-label">文件下载*</label>
                                    <div class="col-sm-10">
                                        <a class="upload-icon" ng-click="downloadAgreement();">协议文件下载</a>
                                    </div>
                                </div>
                            </div>
                        </section>

                        <section class="panel">
                            <div class="panel-heading">
                                审批记录
                            </div>
                            <div class="panel-body">
                                <ul class="tp-ulst">
                                    <li>
                                        <span>人员姓名 </span><span>修改时间</span><span>处理结果</span>
                                    </li>
                                    <div ng-repeat="ss in processs">
                                        <li>
                                            <span>{{ss.USER}}</span><span>{{ss.time | date:'yyyy-MM-dd hh:mm'}}</span><span>{{getsssbbb(ss.lastStatus)}}，{{ss.msg}}</span>
                                        </li>
                                    </div>
                                </ul>
                            </div>
                        </section>
                    </div>
                    
                    <section class="panel" id="printbox" style="display:none;">
                        <header class="panel-heading add-heading">
                            供货协议
                            <span class="add-icon">合同编号：{{agreement.contractCode}}</span>
                        </header>
                        <div class="panel-body">
                            <table class="table table-bordered">
                                <tbody>
                                    <tr style="background:#999;color:#fff;">
                                        <td colspan="8"><strong>基本信息</strong></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">请购单编号</td>
                                        <td colspan="2">{{agreement.buyingRequisitionCode}}</td>
                                        <td colspan="2">比价单编号</td>
                                        <td colspan="2">{{agreement.pcsCode}}</td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">供应商名称</td>
                                        <td colspan="2">{{agreement.supplierName}}</td>
                                        <td colspan="2">归属分公司</td>
                                        <td colspan="2">{{agreement.affiliateName}}</td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">价格(含税&折扣)</td>
                                        <td colspan="2">{{agreement.priceDiscount}}</td>
                                        <td colspan="2">交货期</td>
                                        <td colspan="2">{{agreement.deliveryDate}}</td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">质保期</td>
                                        <td colspan="2">{{agreement.guaranteeDate}}</td>
                                        <td colspan="2">付款方式</td>
                                        <td colspan="2">{{agreement.paymentMethod}}</td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">留言</td>
                                        <td colspan="6">{{agreement.agreementMsg}}</td>
                                    </tr>
                                    <tr style="background:#999;color:#fff;">
                                        <td colspan="8"><strong>协议清单</strong></td>
                                    </tr>
                                    <tr style="font-weight:bold;">
                                        <td>类目</td>
                                        <td>类别</td>
                                        <td>名称</td>
                                        <td>品名及规格</td>
                                        <td>数量</td>
                                        <td>单价</td>
                                        <td>合计</td>
                                        <td>备注</td>
                                    </tr>
                                    <tr ng-repeat="bubu in buyingItems">
                                        <td>{{bubu.cateName}}</td>
                                        <td>{{bubu.className}}</td>
                                        <td>{{bubu.name}}</td>
                                        <td>{{bubu.desc}}</td>
                                        <td>{{bubu.quantity}}</td>
                                        <td>{{bubu.singlePrice}}</td>
                                        <td>{{bubu.amount}}</td>
                                        <td>{{bubu.remarkMac}}</td>
                                    </tr>
                                    <tr style="background:#999;color:#fff;">
                                        <td colspan="8"><strong>审批过程</strong></td>
                                    </tr>
                                    <tr style="font-weight:bold;">
                                        <td colspan="2">处理人</td>
                                        <td colspan="2">处理时间</td>
                                        <td colspan="4">处理结果</td>
                                    </tr>
                                    <tr  ng-repeat="procTrace in processs">
                                        <td colspan="2">{{procTrace.USER}}</td>
                                        <td colspan="2">{{procTrace.time | date:'yyyy-MM-dd hh:mm'}}</td>
                                        <td colspan="4">({{getsssbbb(procTrace.lastStatus)}}){{procTrace.msg}}</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </section>

                    <section class="panel">
                        <div class="panel-body">
                            <p class="default-buttons">
                                <a href="javascript:void(0);" class="button-back btn btn-info" onclick="window.history.back()">返回</a>
                                <a href="javascript:void(0);" class="button-next  btn btn-primary btn-l10" id="word">导出word</a>
                                <a href="javascript:void(0);" class="button-next  btn btn-success btn-l10" id="print">打印单据</a>
                            </p>
                        </div>
                    </section>

                    <!-- Modal -->
                    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                        aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <section class="panel">
                                    <div class="panel-heading add-heading">
                                        文件列表
                                        <i class="add-icon icon-remove" data-dismiss="modal" aria-hidden="true"></i>
                                    </div>
                                    <div class="panel-body">
                                        <p>点击 <a onclick="downLoad(this)" class="down-icon">文件名测试数据.txt</a> 下载!
                                            2018-01-02 16:55</p>
                                        <input class="fileDownloadPath" value="{{fileId}}" type="hidden" />
                                    </div>
                                    <div class="panel-bg"></div>
                                </section>
                            </div>
                            <!-- /.modal-content -->
                        </div>
                        <!-- /.modal-dialog -->
                    </div>
                    <!-- /.modal -->

                </div>
            </div>
        </section>
    </section>
    <!--main content end-->
</section>

<script type="text/javascript" src="js/agreement/agreement.js"></script>


<!-- 打印组件 -->
<script type="text/javascript" src="assets/print/jquery.jqprint-0.3.js"></script>

<!-- 导出word组件 -->
<script type="text/javascript" src="assets/html2word/FileSaver.js"></script>
<script type="text/javascript" src="assets/html2word/jquery.wordexport.js"></script>

<script>
    $(function () {
        //打印初始化
        $("#print").click(function () {
            $(".ptop-list").hide();
            $("#printbox").show();
            $("#printbox").jqprint();
        })
        //导出word
        $("#word").click(function () {
            $(".ptop-list").hide();
            $("#printbox").show();
            $("#printbox").wordExport();
        })
    })
</script>